package com.ebt.m.data.rxModel.api;

import com.ebt.m.account.json.AccountResponse;
import com.ebt.m.account.json.BindPhoneRequest;
import com.ebt.m.account.json.ChangePasswordRequest;
import com.ebt.m.account.json.ResetPasswordRequest;
import com.ebt.m.account.json.UserInfoRequest;
import com.ebt.m.account.json.ValidateCodeCheckRequest;
import com.ebt.m.account.json.ValidateCodeCheckResponse;
import com.ebt.m.account.json.ValidateCodeSendRequest;
import com.ebt.m.account.json.ValidateCodeSendResponse;
import com.ebt.m.apps.response.ResponseModule;
import com.ebt.m.commons.model.data.BaseDataResult;
import com.ebt.m.customer.entity.CustomerAtta;
import com.ebt.m.customer.entity.CustomerAttaName;
import com.ebt.m.customer.entity.CustomerBatchDelete;
import com.ebt.m.customer.entity.CustomerDelete;
import com.ebt.m.customer.entity.CustomerDetail;
import com.ebt.m.customer.entity.CustomerSimple;
import com.ebt.m.customer.net.json.CustomerAttaListJson;
import com.ebt.m.customer.net.json.CustomerCRUDRetJson;
import com.ebt.m.customer.net.json.CustomerDetailJson;
import com.ebt.m.customer.net.json.CustomerDynamicListJson;
import com.ebt.m.customer.net.json.CustomerListJson;
import com.ebt.m.customer.net.json.CustomerNoteDetailJson;
import com.ebt.m.customer.net.json.CustomerNoteJson;
import com.ebt.m.customer.net.json.CustomerNoteListJson;
import com.ebt.m.customer.net.json.CustomerSearchListJson;
import com.ebt.m.data.bean.Brand;
import com.ebt.m.data.bean.CardInfo;
import com.ebt.m.data.bean.ProposalListItem;
import com.ebt.m.data.bean.ProposalListJson;
import com.ebt.m.data.bean.ResponseProductTag;
import com.ebt.m.data.bean.UserInfo;
import com.ebt.m.data.entity.CompanyProduct;
import com.ebt.m.data.entity.NewProductInfo;
import com.ebt.m.data.entity.ProductsResult;
import com.ebt.m.data.entity.Response4IsFollow;
import com.ebt.m.data.rxModel.apibean.ApiPolicyProducts;
import com.ebt.m.data.rxModel.apibean.ApiProduct;
import com.ebt.m.data.rxModel.apibean.DeleteResult;
import com.ebt.m.data.rxModel.apibean.DeviceIdParam;
import com.ebt.m.data.rxModel.apibean.DynamicsCountData;
import com.ebt.m.data.rxModel.apibean.FilterDataBean;
import com.ebt.m.data.rxModel.apibean.LoginParam;
import com.ebt.m.data.rxModel.apibean.ModuleCount;
import com.ebt.m.data.rxModel.apibean.OpportunityDataResult;
import com.ebt.m.data.rxModel.apibean.PerformanceAll;
import com.ebt.m.data.rxModel.apibean.PhoneEventAddParam;
import com.ebt.m.data.rxModel.apibean.PolicyEntity;
import com.ebt.m.data.rxModel.apibean.ProductItemsBean;
import com.ebt.m.data.rxModel.apibean.ProductSearchBean;
import com.ebt.m.data.rxModel.apibean.ProductSearchCategory;
import com.ebt.m.data.rxModel.apibean.ProductSearchResult;
import com.ebt.m.data.rxModel.apibean.QuickLoginParam;
import com.ebt.m.data.rxModel.apibean.ApiOnlinePolicySearchDataBean;
import com.ebt.m.data.rxModel.apibean.SearchHistory;
import com.ebt.m.data.rxModel.apibean.StarOrRecommendData;
import com.ebt.m.data.rxModel.apibean.ThirtyLoginParam;
import com.ebt.m.jpush.PushToken;
import com.ebt.m.jpush.PushTokenResult;
import com.ebt.m.proposal_v2.dao.request.DraftParam;
import com.ebt.m.proposal_v2.dao.request.ParamGetAttaches;
import com.ebt.m.proposal_v2.dao.request.ParamSaveProposalTaps;
import com.ebt.m.proposal_v2.dao.request.ProposalParam;
import com.ebt.m.proposal_v2.dao.response.ResponseAttach;
import com.ebt.m.proposal_v2.dao.response.ResponseBrand;
import com.ebt.m.proposal_v2.dao.response.ResponseBrandProduct;
import com.ebt.m.proposal_v2.dao.response.ResponseChanShuoItem;
import com.ebt.m.proposal_v2.dao.response.ResponseDraft;
import com.ebt.m.proposal_v2.dao.response.ResponseHistory;
import com.ebt.m.proposal_v2.dao.response.ResponseIsOpenInsurance;
import com.ebt.m.proposal_v2.dao.response.ResponseMain;
import com.ebt.m.proposal_v2.dao.response.ResponseMainDetail;
import com.ebt.m.proposal_v2.dao.response.ResponseMakeProposal;
import com.ebt.m.proposal_v2.dao.response.ResponsePickNum;
import com.ebt.m.proposal_v2.dao.response.ResponseProductProperties;
import com.ebt.m.proposal_v2.dao.response.ResponseProposalCardInfo;
import com.ebt.m.proposal_v2.dao.response.ResponseProposalTap;
import com.ebt.m.proposal_v2.dao.response.ResponseSaveTaps;
import com.ebt.m.proposal_v2.dao.response.ResponseSendProposal;
import com.ebt.m.proposal_v2.dao.response.ResponseTapDelete;
import com.ebt.m.proposal_v2.dao.response.ResponseTapFile;
import com.ebt.m.proposal_v2.dao.response.ResponseTouDan;
import com.ebt.m.proposal_v2.retrofit.ResponseBodyBase;
import com.ebt.m.users.bean.CardData;
import com.ebt.m.users.bean.CardHonour;
import com.ebt.m.users.bean.CardService;
import com.ebt.m.wiki.MResponse;
import com.google.gson.JsonObject;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * Created by andy.wang on 2016/12/9.
 */

public interface EBTAPI {

    // erp

    @GET("erp/user/newpolicy/count")
    Observable<BaseDataResult<PerformanceAll>> getPersonalPerformance();

    @GET("erp/policy/unreceiptback")
    Observable<BaseDataResult<List<PolicyEntity>>> getUnReceiptBacks(@Query("page") int page, @Query("pageSize") int pageSize);

    @GET("erp/policy/receivable")
    Observable<BaseDataResult<List<PolicyEntity>>> getReceivablePolicy(@Query("page") int page, @Query("pageSize") int pageSize);

    // user

    @POST("user/login")
    Observable<BaseDataResult<UserInfo>> getLoginToken(@Body LoginParam param);

    @GET("app/systemTime/get")
    Observable<Response<ResponseBody>> getServerTime();

    @POST("app/deviceId/create")
    Observable<Response<ResponseBody>> getDeviceId(@Body DeviceIdParam jsonBody);

    @POST("user/logout")
    Observable<Response<ResponseBody>> userLoginOut();

    @POST("user/thirdPartLogin")
    Observable<BaseDataResult<UserInfo>> getThirtyLogin(@Body ThirtyLoginParam loginParam);

    @GET("user/isValidate")
    Observable<BaseDataResult<UserInfo>> isAuthenticate();

    @POST("user/fastLogin")
    Observable<BaseDataResult<UserInfo>> quickLogin(@Body QuickLoginParam loginParam);

    @POST("user/myCard/base/save")
    Observable<Response<ResponseBody>> modifyCardData(@Body CardData cardData);

    @POST("user/myCard/attachment/honour/save")
    Observable<Response<ResponseBody>> saveHonour(@Body CardHonour cardHonour);

    @POST("user/myCard/attachment/service/save")
    Observable<Response<ResponseBody>> saveService(@Body CardService cardService);

    @POST("user/myCard/introduction/save")
    Observable<Response<ResponseBody>> saveCardIntroduction(@Body CardData cardData);

    @DELETE("user/myCard/attachment/delete")
    Observable<Response<ResponseBody>> deleteCarddataItem(@Query("attachmentId") int attachmentId);

    /**
     * 获取erp个人资料
     *
     * @return
     */
    @GET("erp/user/info/get")
    Observable<BaseDataResult<CardInfo>> getERPCardInfo();

    /**
     * 获取名片信息
     *
     * @return
     */
    @GET("user/myCard/get")
    Observable<BaseDataResult<CardData>> getCardData();

    /**
     * 获取模块
     */
    @GET("user/modules/new/get")
    Observable<BaseDataResult<ResponseModule>> getModules1();

    /**
     * 获取模块数量
     */
    @GET("user/modules/message/count/get")
    Observable<BaseDataResult<List<ModuleCount>>> getModuleCount();

    @GET("customer/dynamicsCount/get")
    Observable<BaseDataResult<DynamicsCountData>> getDynamicsCount();

    @POST("customer/{customerId}/phoneCall/create")
    Observable<Response<ResponseBody>> createPhoneEvent(@Path("customerId") String customerId, @Body PhoneEventAddParam phoneEventAddParam);

    /**
     * 获取所有的customer，不进行分页
     */
    @GET("customer/customerList/get?all=1")
    Observable<CustomerListJson> getCustomerList();


    /**
     * 上传一个新的customer
     */
    @POST("customer/baseinfo/create")
    Observable<CustomerCRUDRetJson> createCustomer(@Body CustomerDetail entity);

    /**
     * 更新一个customer
     */
    @PUT("customer/{customerId}/baseinfo/update")
    Observable<CustomerCRUDRetJson> updateCustomer(@Path("customerId") String customerId,
                                                   @Body CustomerDetail entity);

    /**
     * 批量增加客户
     */
    @POST("customer/baseinfo/batch/create")
    Observable<CustomerCRUDRetJson> createBatchCustomer(@Body List<CustomerDetail> entity);

    /**
     * 批量删除客户
     *
     * @param entity
     * @return
     */
    @HTTP(method = "DELETE", path = "/customer/baseinfo/batch/delete", hasBody = true)
    Observable<CustomerCRUDRetJson> deleteBatchCustomer(@Body List<CustomerDelete> entity);

    /**
     * 批量删除客户
     *
     * @param entity
     * @return
     */
    @HTTP(method = "DELETE", path = "/customer/baseinfo/batch/delete", hasBody = true)
    Observable<CustomerCRUDRetJson> deleteBatchCustomer(@Body String entity);

    /**
     * 批量删除客户
     *
     * @param entity
     * @return
     */
    @HTTP(method = "DELETE", path = "/customer/baseinfo/batch/delete", hasBody = true)
    Observable<CustomerCRUDRetJson> deleteBatchCustomer(@Body CustomerBatchDelete entity);

    /**
     * 根据customerUuid获取一个customer的详细信息
     */
    @GET("customer/{customerId}/baseinfo/get")
    Observable<CustomerDetailJson> getCustomerDetail(@Path("customerId") String customerId);

    /**
     * 根据customerUuid获取一个customer的详细信息
     */
    @GET("customer/name/{customerName}/get")
    Observable<CustomerSearchListJson> searchCustomerByName(@Path("customerName") String customerName);

    /**
     * 获取活动客户列表
     */
    @GET("/customer/active/customerList/get")
    Observable<BaseDataResult<List<CustomerSimple>>> getCustomerAllActive();

    /**
     * 获取保单客户列表
     */
    @GET("/customer/customerList/get")
    Observable<BaseDataResult<List<CustomerSimple>>> getCustomerAllPolicy(@Query("tag") int tag);

    /**
     * 删除customer
     */
    @DELETE("customer/baseinfo/{customerId}/delete")
    Observable<CustomerCRUDRetJson> deleteCustomerById(@Path("customerId") String customerId);


    /**
     * 根据customerUuid获取所有笔记
     */
    @GET("customer/{customerId}/noteList/get")
    Observable<CustomerNoteListJson> getNoteListByCustomerId(@Path("customerId") String customerId);

    /**
     * 根据noteId获取笔记内容
     */
    @GET("customer/note/{noteId}/get")
    Observable<CustomerNoteDetailJson> getNoteContentByCustomerId(@Path("noteId") String noteId);

    /**
     * 上传一个新的笔记
     */
    @POST("customer/note/create")
    Observable<CustomerNoteDetailJson> createNote(@Body CustomerNoteJson entity);

    /**
     * 删除笔记
     */
    @DELETE("customer/note/{noteId}/delete")
    Observable<CustomerNoteDetailJson> deleteNoteById(@Path("noteId") String noteId);

    /**
     * 更新一个笔记
     */
    @PUT("customer/note/update")
    Observable<CustomerNoteDetailJson> updateNote(@Body CustomerNoteJson entity);

    /**
     * 删除一个tape
     */
    @DELETE("customer/note/{noteId}/tape/{tapeId}/delete")
    Observable<CustomerNoteDetailJson> deleteTapeById(@Path("noteId") String noteId,
                                                      @Path("tapeId") String tapeId);

    /**
     * 根据customerUuid获取所有附件的详细信息，暂时没有添加分页功能
     */
    @GET("customer/{customerId}/attachmentList/get")
    Observable<CustomerAttaListJson> getCustomerAllAttachment(@Path("customerId") String customerId);

    /**
     * 增加一个新的附件
     */
    @POST("/customer/attachment/create")
    Observable<CustomerCRUDRetJson> createAtta(@Body CustomerAtta entity);

    /**
     * 更新附件
     */
    @PUT("/customer/attachment/{attachmentId}/update")
    Observable<CustomerCRUDRetJson> updateAttaName(@Path("attachmentId") String attachmentId, @Body CustomerAttaName body);

    /**
     * 删除附件
     */
    @DELETE("/customer/attachment/{attachmentId}/delete")
    Observable<CustomerCRUDRetJson> deleteAtta(@Path("attachmentId") String attachmentId);

    /**
     * 动态
     */
    @GET("/customer/{customerId}/dynamicsList/get")
    Observable<CustomerDynamicListJson> getCustomerDynamicList(@Path("customerId") String customerId);

    // policy

    /**
     * 创建保单附件
     *
     * @param policyId
     * @param body
     * @return
     */
    @POST("/customer/policy/{policyId}/attachment/create")
    Call<JsonObject> createPolicyAttachment(
            @Path("policyId") String policyId,
            @Body RequestBody body
    );

    /**
     * 删除保单附件
     *
     * @param policyId
     * @param body
     * @return
     */
//    @DELETE("/customer/policy/{policyId}/attachment/delete")
    @HTTP(method = "DELETE", path = "/customer/policy/{policyId}/attachment/delete", hasBody = true)
    Call<JsonObject> deletePolicyAttachment(
            @Path("policyId") String policyId,
            @Body RequestBody body
    );

    /**
     * 获取客户所有保单
     *
     * @param customerId
     * @return
     */
    @GET("/customer/{customerId}/policyList/get")
    Call<JsonObject> getAllCustomerPolicys(
            @Path("customerId") String customerId
    );

    /**
     * 分页获取客户保单
     *
     * @param customerId
     * @return
     */
    @GET("/customer/{customerId}/policyList/get")
    Call<JsonObject> getCustomerPolicys(
            @Path("customerId") String customerId,
            @Query("page") int page,
            @Query("pageSize") int pageSize
    );

    /**
     * 创建保单
     *
     * @param body
     * @return
     */
    @POST("/customer/policy/create")
    Call<JsonObject> createPolicy(@Body RequestBody body);

    /**
     * 删除保单
     *
     * @param policyId
     * @return
     */
    @DELETE("/customer/policy/{policyId}/delete")
    Call<JsonObject> deletePolicy(@Path("policyId") String policyId);

    /**
     * 更新保单
     *
     * @param body
     * @return
     */
    @PUT("/customer/policy/update")
    Call<JsonObject> updatePolicy(@Body RequestBody body);

    /**
     * 品牌列表
     *
     * @param page
     * @param pageSize
     * @return
     */
    @GET("/risk/brand/list")
    Call<JsonObject> getCompanyList(@Query("page") int page, @Query("pageSize") int pageSize);

    /**
     * 创建推送Token(返回Token用于设置JPush推送别名)
     *
     * @return
     */
    @POST("/app/pushToken/create")
    Observable<BaseDataResult<PushTokenResult>> createPushToken(@Body PushToken body);


    // opportunity
    @GET("proposal/bsnsOprtnty/list")
    Observable<BaseDataResult<List<OpportunityDataResult>>> getOpportunities(@Query("page") int page, @Query("pageSize") int pageSize);

    @PUT("proposal/bsnsOprtnty/{id}/read")
    Observable<Response<ResponseBody>> readMessage(@Path("id") int opportunityId);

    // product
    @GET("risk/product/followList")
    Observable<BaseDataResult<StarOrRecommendData>> getStarProducts(@Query("page") int page, @Query("pageSize") int pageSize);

    @GET("erisk/company/product/recommend/list/v2/get")
    Observable<BaseDataResult<List<NewProductInfo>>> getRecommondProducts(@Query("page") int page, @Query("pageSize") int pageSize);

    @GET("risk/product/search/category/get")
    Observable<BaseDataResult<ProductSearchCategory>> getBrands(@Query("companyId") int companyId);


    @GET("risk/product/company/{companyId}/sellingProductCount")
    Observable<BaseDataResult<Integer>> getCompanySellingCount(@Path("companyId") int companyId);


    /**
     * 获取版本号
     *
     * @return
     */
    @GET("latestversion")
    Observable<Response<ResponseBody>> getLatestversion(@Header("Authorization") String authorization);

    /**
     * 获取变更产品列表
     *
     * @param oriVersion
     * @return
     */
    @GET("products/updated/{oriVersion}")
    Observable<Response<ResponseBody>> getOriVersion(@Header("Authorization") String authorization, @Path("oriVersion") String oriVersion);

    /**
     * 获取产品详细情况
     *
     * @param oriVersion
     * @return
     */
    @GET("version/{oriVersion}/{showarea}")
    Observable<Response<ResponseBody>> getVersionDetail(@Header("Authorization") String authorization, @Path("oriVersion") int oriVersion, @Path("showarea") int showarea);


    /**
     * 文件下载
     *
     * @param url
     * @return
     */
    @GET
    Call<ResponseBody> downLoadFile(@Url String url);

    /**
     * 下载单个产品json
     *
     * @param productId
     * @return
     */
    @GET("product/json/{productid}")
    Call<ResponseBody> getProductJson(@Header("Authorization") String authorization, @Path("productid") String productId);


    /**
     * 查询主险的附加险列表
     *
     * @param authorization
     * @param brandId
     * @param productId
     * @return {
     * "addtionalProducts": [
     * {
     * "productName": "长城附加保险费豁免定期寿险",
     * "productID": 1399
     * },
     * {
     * "productName": "长城附加定期重大疾病保险",
     * "productID": 1424
     * }
     * ]
     * }
     */
    @GET("products/additional/{brandId}/{productId}")
    Observable<Response<ResponseBody>> getAttatchProductIdListJson(@Header("Authorization") String authorization, @Path("brandId") String brandId, @Path("productId") String productId);

    /**
     * 根据产品id获取标签
     *
     * @param productIds-逗号分隔的产品id字符串
     * @return
     */
    @GET("product/tags/product/{productIds}")
    Observable<List<ResponseProductTag>> getProductTagsByProductIds(@Header("Authorization") String authorization, @Path("productids") String productIds);

    /**
     * 根据品牌id获取标签
     *
     * @param brandid-逗号分隔的产品id字符串
     * @return
     */
    @GET("data/product/tags/brand/{brandid}")
    Observable<List<ResponseProductTag>> getProductTagsByBrandOld(@Header("Authorization") String authorization, @Path("brandid") String brandid);

    /**
     * 根据品牌id获取标签
     *
     * @param brandid-逗号分隔的产品id字符串
     * @return
     */
    @GET("data/product/tags/brand/{brandid}")
    Observable<List<ResponseProductTag>> getProductTagsByBrand(@Path("brandid") String brandid);


    @GET("data/brand/productorder/{companyid}")
    Observable<List<String>> getRecommondProductOrder(@Header("Authorization") String authorization, @Path("companyid") String companyid);

    /**
     * 关注产品
     *
     * @return
     */
    @POST("risk/product/{productId}/follow")
    Observable<MResponse> followProduct(@Path("productId") int productId);

    /**
     * 取消关注产品
     *
     * @return
     */
    @POST("risk/product/{productId}/cancelFollow")
    Observable<MResponse> cancelFollowProduct(@Path("productId") int productId);

    /**
     * 关注产品列表
     *
     * @param page
     * @param pageSize
     * @return
     */
    @GET("risk/product/followList")
    Observable<ProductsResult> getFollowProducts(@Query("page") int page, @Query("pageSize") int pageSize);

    /**
     * 判断是否是关注产品
     *
     * @param productId
     * @return
     */
    @GET("risk/product/{productId}/isFollow")
    Observable<MResponse<Response4IsFollow>> isFollow(@Path("productId") int productId);

    /**
     * 常用
     *
     * @return
     */
    @POST("risk/product/{productId}/commonUse")
    Observable<MResponse> commonUseProduct(@Path("productId") int productId);

    /**
     * 取消常用
     *
     * @return
     */
    @POST("risk/product/{productId}/cancelCommonUse")
    Observable<MResponse> cancelCommonUseProduct(@Path("productId") int productId);

    /**
     * 关注的产品列表
     *
     * @param page
     * @param pageSize
     * @return
     */
    @GET("risk/product/companySellingAndFollowList")
    Observable<BaseDataResult<List<NewProductInfo>>> getCompanyFollowProducts(@Query("page") int page, @Query("pageSize") int pageSize, @Query("companyId") int companyId);

    /**
     * 全部产品列表
     * 某个公司下的所有产品(根据公司分类)
     *
     * @param companyId
     * @param topN
     * @return
     */
    @GET("risk/product/brandListWithTopN")
    Observable<BaseDataResult<List<CompanyProduct>>> getAllProductsByCompany(@Query("companyId") int companyId, @Query("topN") int topN);

    @POST("erisk/product/search/v2")
    Observable<BaseDataResult<ProductSearchResult>> getSearchProducts(@Query("page") int page, @Query("pageSize") int pageSize, @Body ProductSearchBean searchBean);

    /**
     * @param from(1隽保哥寿险百科2隽保哥公司产品库3宜保通寿险百科)
     * @param category(1品牌搜索历史2关键字搜索历史)
     * @param page
     * @param pageSize
     * @return
     */
    @GET("erisk/product/searchHistory/get")
    Observable<BaseDataResult<List<SearchHistory>>> getSearchHistorys(@Query("from") int from, @Query("category") int category, @Query("page") int page, @Query("pageSize") int pageSize);

    /**
     * 删除浏览记录
     *
     * @param from(1隽保哥寿险百科2隽保哥公司产品库3宜保通寿险百科)
     * @param category(1品牌搜索历史2关键字搜索历史)
     * @return
     */
    @DELETE("erisk/product/searchHistory/delete")
    Observable<DeleteResult> deleteSearchHistorys(@Query("from") int from, @Query("category") int category);

    /**
     * 根据产品id从服务器获取产品信息
     *
     * @param productId
     * @return
     */
    @GET("erisk/product/{productId}/get")
    Observable<BaseDataResult<ApiProduct>> getProductFromAPI(@Path("productId") int productId);

    /**
     * 获取Proposal的接口，page从1开始
     * status:
     * 1:草稿
     * 2:未发送
     * 3:已发送
     * 4:已查看
     * -1:获取全部
     */
    @GET("/proposal/list/get")
    Observable<ProposalListJson> getProposalList(@Query("page") int pageIndex, @Query("pageSize") int pageSize, @Query("status") int status);

    @GET("/proposal/list/get?page=1&pageSize=1000&status=-1")
    Observable<BaseDataResult<List<ProposalListItem>>> getProposalListByCustomerId(@Query("customerId") String customerId);


    @GET("/proposal/list/get")
    Observable<BaseDataResult<List<ProposalListItem>>> fetchProposalList(@Query("page") int pageIndex, @Query("pageSize") int pageSize, @Query("status") int status);

    @DELETE("/proposal/{pickNum}/delete")
    Observable<Response<ResponseBody>> deleteProposal(@Path("pickNum") String pickNum);

    /****
     * 账户相关
     ****/

    //查询某个电话号码是否被占用
    @POST("/user/phone/{phoneNumber}/ifBind")
    Observable<BaseDataResult<AccountResponse>> checkPhoneNumberIfBound(@Path("phoneNumber") String phoneNumber, @Header("Token") String token);

    //绑定新的手机号，或者更改绑定的手机号
    @POST("/user/phone/bind")
    Observable<BaseDataResult<AccountResponse>> bindPhoneNumber(@Body BindPhoneRequest entity, @Header("Token") String token);

    //用户修改密码
    @POST("/user/password/update")
    Observable<BaseDataResult<AccountResponse>> changeAccountPassword(@Body ChangePasswordRequest entity);

    //用户重置密码，传入username，这里的username为绑定手机号
    @POST("/user/password/reset")
    Observable<BaseDataResult<AccountResponse>> resetAccountPassword(@Body ResetPasswordRequest entity);

    //前台发送手机验证码
    @POST("/app/validate/validatePhone")
    Observable<BaseDataResult<ValidateCodeSendResponse>> sendValidateCode(@Body ValidateCodeSendRequest entity);

    //前台手机验证码验证
    @POST("/app/validate/ValidatePhoneCheck")
    Observable<BaseDataResult<ValidateCodeCheckResponse>> checkValidateCode(@Body ValidateCodeCheckRequest entity);

    //根据userid获取对应的info
    @POST("/user/userInfo/get")
    Observable<BaseDataResult<UserInfo>> getUserInfoByUserId(@Body UserInfoRequest entity);

    //取消认证
    @PUT("agentManagement/cancelValidate")
    Observable<BaseDataResult<AccountResponse>> cancelAuth();

    /**************************
     * 计划书预览接口
     ***************************/

    /**
     * 计划书发送
     *
     * @param proposalID
     * @return
     */
    @GET("proposal/{pickNum}/send")
    Observable<ResponseBodyBase<ResponseSendProposal>> sendPropsosal(@Path("pickNum") String proposalID);

    /**
     * 保存计划书语音
     *
     * @param params
     * @return
     */
    @POST("proposal/leaveMessage/save")
    Observable<ResponseBodyBase<ResponseSaveTaps>> saveProposalTaps(@Body ParamSaveProposalTaps params);

    /**
     * 上传语音到OSS
     *
     * @param files
     * @param folderId
     * @param oSSBucketName
     * @param oSSPath
     * @return
     */
    @Multipart
    @POST("/file/upload")
    Observable<ResponseBodyBase<ResponseTapFile>> updateProposalTapToOSS(@Part MultipartBody.Part files,
                                                                         @Query("floderId") String folderId,
                                                                         @Query("ossBucketName") String oSSBucketName,
                                                                         @Query("ossDiskPath") String oSSPath);

    /**
     * 上传file到OSS
     *
     * @param files
     * @param folderId
     * @param oSSBucketName
     * @param oSSPath
     * @return
     */
    @Multipart
    @POST("file/upload")
    Observable<ResponseBodyBase<ResponseTapFile>> updateFile(@Part MultipartBody.Part files,
                                                             @Query("floderId") String folderId,
                                                             @Query("ossBucketName") String oSSBucketName,
                                                             @Query("ossDiskPath") String oSSPath);

    /**
     * 删除计划书语音
     *
     * @param tapId
     * @return
     */
    @POST("/file/{fileId}/delete")
    Observable<ResponseBodyBase<ResponseTapDelete>> deleteProposalTap(@Path("fileId") String tapId);

    /**
     * 根据计划书ID获取语音信息
     *
     * @param proposalId
     * @return
     */
    @GET("/proposal/leaveMessage/list?")
    Observable<ResponseBodyBase<List<ResponseProposalTap>>> getProposalTapById(@Query("pickNum") String proposalId);

    /*****************************
     * 主险附加险
     ******************************/

    /**
     * 获取附加险列表
     *
     * @param param
     * @return
     */
    @POST("/erisk/product/addRisk/list/v2")
    Observable<ResponseBodyBase<List<ResponseAttach>>> getAdditionalRisks(@Body ParamGetAttaches param);

    /**
     * 获取主险列表 - 常用产品
     *
     * @param params
     * @return
     */
    @GET("/proposal/product/newly/get")
    Observable<ResponseBodyBase<List<ResponseMain>>> getCommonRisks(@QueryMap Map<String, String> params);


    /**
     * 获取是否可以在线投单
     */
    @GET("/erisk/company/product/isOpenInsurance")
    Observable<ResponseBodyBase<ResponseTouDan>> getResponseTouDan(@Query("productId") int productId);

    /**
     * 获取主险详情 - 保险选项以及绑定的附加险
     *
     * @param productId
     * @return
     */
    @GET("/erisk/product/{productId}/default/get")
    Observable<ResponseBodyBase<ResponseMainDetail>> getMainDetails(
            @Path("productId") int productId, @Query("age") String age, @Query("sex") int sex, @Query("profession") int profession);

    /**
     * 获取主险详情 - 保险选项以及绑定的附加险{不传age/sex/profession,用于获取产品的详细信息以及默认的投保人信息}
     *
     * @param productId
     * @return
     */
    @GET("/erisk/product/{productId}/default/get")
    Observable<ResponseBodyBase<ResponseMainDetail>> getDefaultMainProductDetails(@Path("productId") int productId);

    /**
     * 点击产说会，弹出列表
     *
     * @param productId
     * @return
     */
    @GET("/erisk/product/learn/list")
    Observable<ResponseBodyBase<List<ResponseChanShuoItem>>> getChanShuoHuiList(@Query("productId") int productId);


    /**
     * 是否可在线投单
     *
     * @param productId
     * @return
     */
    @GET("/erisk/company/product/isOpenInsurance")
    Observable<ResponseBodyBase<ResponseIsOpenInsurance>> getIsOpenInsurance(@Path("productId") int productId);

    /**
     * 获取代理品牌
     *
     * @return
     */
    @GET("/erisk/company/brand/list/byAgent/get")
    Observable<ResponseBodyBase<List<ResponseBrand>>> getBrands();

    /**
     * 获取代理品牌关联的产品，并提交到历史记录
     *
     * @return
     */
    @GET("/erisk/company/products/byAgent/get")
    Observable<ResponseBodyBase<List<ResponseBrandProduct>>> getBrandProductsAndSubmitHistory(@QueryMap Map<String, String> param);

    /**
     * 搜索产品
     *
     * @return
     */
    @GET("/erisk/company/{companyId}/productList/get")
    Observable<ResponseBodyBase<List<ResponseBrandProduct>>> searchBrandProducts(@Path("companyId") int companyId, @QueryMap Map<String, String> param);

    /**
     * 获取品牌历史记录
     *
     * @param param
     * @return
     */
    @GET("/erisk/product/searchHistory/get")
    Observable<ResponseBodyBase<List<ResponseHistory>>> getBrandHistorys(@QueryMap Map<String, String> param);

    @GET("/erisk/company/brand/list/byAgent/get")
    Observable<BaseDataResult<List<Brand>>> getBrandsByCompanyId(@Query("companyId") int companyId);

    @GET("/proposal/product/maybeSearch/get?page=1&pageSize=6")
    Observable<BaseDataResult<List<Brand>>> getBrandsMaybeSearch();


    /**************************
     * 计划书制作
     *************************/


    /**
     * 保存到计划书草稿
     *
     * @param entity
     * @return
     */
    @POST("/proposal/draft/save")
    Observable<ResponseBodyBase<ResponsePickNum>> saveToProposalDraft(@Body DraftParam entity);

    /**
     * 制作计划书
     *
     * @param entity
     * @return
     */
    @POST("/proposal/save")
    Observable<ResponseBodyBase<ResponseMakeProposal>> makeProposal(@Body ProposalParam entity);

    /**
     * 获取计划书草稿
     *
     * @param proposalId
     * @return
     */
    @GET("/proposal/{pickNum}/get")
    Observable<ResponseBodyBase<ResponseDraft>> getProposalDraft(@Path("pickNum") String proposalId);

    /**
     * 校验计划书
     *
     * @param entity
     * @return
     */
    @POST("/proposal/check")
    Observable<ResponseBodyBase<List<String>>> verifyProposal(@Body ProposalParam entity);

    /**
     * 上传文件
     *
     * @param url
     * @return
     */
    @Multipart
    @POST
    Observable<ResponseBodyBase<ResponseProposalCardInfo>> uploadIDPic(@Url String url,
                                                                       @Part MultipartBody.Part files,
                                                                       @Query("side") String side);

    /**
     * @return
     */
    @FormUrlEncoded
    @POST("/policy/shareSignStatus/to/shareSigning")
    Observable<BaseDataResult> shareSigning(@Field("policyId") int policyId);

    /**
     * 查询可投单产品列表接口
     *
     * @return
     */
    @GET("/erisk/online/policy/products/viaBrand")
    Observable<BaseDataResult<List<ApiPolicyProducts>>> getBrandsProducts(@QueryMap Map<String, String> params);

    /**
     * 查询可投单的品牌下可投单产品列表接口
     * 分页查询可投单的品牌下的可投单的产品集合（包括寿险 1、 网销 2 ）
     *
     * @return
     */
    @GET("/erisk/online/policy/products")
    Observable<BaseDataResult<List<ProductItemsBean>>> getPolicyProducts(@QueryMap Map<String, String> params);

    /**
     * 查询可投单产品的筛选条件集合接口
     */
    @GET("/erisk/online/policy/product/filter/collection")
    Observable<BaseDataResult<List<FilterDataBean>>> getFilterCollections();

    /**
     * 可投单产品及计划书集合 搜索接口
     */
    @GET("/erisk/online/policy/products/search")
    Observable<BaseDataResult<ApiOnlinePolicySearchDataBean>> getOnlinePolicySearch(@Query("wd") String wd);

    /**
     * 费报表查询
     */
    @GET("/erisk/product/rate/get")
    Observable<BaseDataResult<HashMap<String,Double>>> getRate(@Query("productId") int productId, @Query("age") String age, @Query("sex") String sex);

    /**
     * 查询产品属性接口
     *
     * @param productId
     * @return
     */
    @GET("/erisk/product/{productId}/config/property/get")
    Observable<ResponseBodyBase<List<ResponseProductProperties>>> getProductPropertiesById(@Path("productId") int productId);

}